3.12 \(\int \frac {a-c+b x}{(1+x^2) \sqrt {a+b x+c x^2}} \, dx\)

Optimal. Leaf size=484 \[ -\frac {\sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \tan ^{-1}\left (\frac {b \sqrt {a^2-2 a c+b^2+c^2}-x \left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2}}-\frac {\sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \tanh ^{-1}\left (\frac {x \left ((a-c) \left (-\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right )+b \sqrt {a^2-2 a c+b^2+c^2}}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2}} \]

[Out]

-1/2*arctan(1/2*(b*(a^2-2*a*c+b^2+c^2)^(1/2)-x*(b^2+(a-c)*(a-c+(a^2-2*a*c+b^2+c^2)^(1/2))))/(a^2-2*a*c+b^2+c^2
)^(1/4)*2^(1/2)/(c*x^2+b*x+a)^(1/2)/(a^2+b^2+c*(c-(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c-(a^2-2*a*c+b^2+c^2)^(1/2))
)^(1/2))*(a^2+b^2+c*(c-(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c-(a^2-2*a*c+b^2+c^2)^(1/2)))^(1/2)/(a^2-2*a*c+b^2+c^2)
^(1/4)*2^(1/2)-1/2*arctanh(1/2*(x*(b^2+(a-c)*(a-c-(a^2-2*a*c+b^2+c^2)^(1/2)))+b*(a^2-2*a*c+b^2+c^2)^(1/2))/(a^
2-2*a*c+b^2+c^2)^(1/4)*2^(1/2)/(c*x^2+b*x+a)^(1/2)/(a^2+b^2+c*(c+(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c+(a^2-2*a*c+
b^2+c^2)^(1/2)))^(1/2))*(a^2+b^2+c*(c+(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c+(a^2-2*a*c+b^2+c^2)^(1/2)))^(1/2)/(a^2
-2*a*c+b^2+c^2)^(1/4)*2^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 23.58, antiderivative size = 484, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {1036, 1030, 208, 205} \[ -\frac {\sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \tan ^{-1}\left (\frac {b \sqrt {a^2-2 a c+b^2+c^2}-x \left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2}}-\frac {\sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \tanh ^{-1}\left (\frac {x \left ((a-c) \left (-\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right )+b \sqrt {a^2-2 a c+b^2+c^2}}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2}} \]

Antiderivative was successfully verified.

[In]

Int[(a - c + b*x)/((1 + x^2)*Sqrt[a + b*x + c*x^2]),x]

[Out]

-((Sqrt[a^2 + b^2 + c*(c - Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c - Sqrt[a^2 + b^2 - 2*a*c + c^2])]*ArcTan[(b
*Sqrt[a^2 + b^2 - 2*a*c + c^2] - (b^2 + (a - c)*(a - c + Sqrt[a^2 + b^2 - 2*a*c + c^2]))*x)/(Sqrt[2]*(a^2 + b^
2 - 2*a*c + c^2)^(1/4)*Sqrt[a^2 + b^2 + c*(c - Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c - Sqrt[a^2 + b^2 - 2*a*
c + c^2])]*Sqrt[a + b*x + c*x^2])])/(Sqrt[2]*(a^2 + b^2 - 2*a*c + c^2)^(1/4))) - (Sqrt[a^2 + b^2 + c*(c + Sqrt
[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c + Sqrt[a^2 + b^2 - 2*a*c + c^2])]*ArcTanh[(b*Sqrt[a^2 + b^2 - 2*a*c + c^2]
 + (b^2 + (a - c)*(a - c - Sqrt[a^2 + b^2 - 2*a*c + c^2]))*x)/(Sqrt[2]*(a^2 + b^2 - 2*a*c + c^2)^(1/4)*Sqrt[a^
2 + b^2 + c*(c + Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c + Sqrt[a^2 + b^2 - 2*a*c + c^2])]*Sqrt[a + b*x + c*x^
2])])/(Sqrt[2]*(a^2 + b^2 - 2*a*c + c^2)^(1/4))

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rule 1030

Int[((g_) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> Dist[-2*
a*g*h, Subst[Int[1/Simp[2*a^2*g*h*c + a*e*x^2, x], x], x, Simp[a*h - g*c*x, x]/Sqrt[d + e*x + f*x^2]], x] /; F
reeQ[{a, c, d, e, f, g, h}, x] && EqQ[a*h^2*e + 2*g*h*(c*d - a*f) - g^2*c*e, 0]

Rule 1036

Int[((g_.) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> With[{q
 = Rt[(c*d - a*f)^2 + a*c*e^2, 2]}, Dist[1/(2*q), Int[Simp[-(a*h*e) - g*(c*d - a*f - q) + (h*(c*d - a*f + q) -
 g*c*e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x] - Dist[1/(2*q), Int[Simp[-(a*h*e) - g*(c*d - a*f + q
) + (h*(c*d - a*f - q) - g*c*e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x]] /; FreeQ[{a, c, d, e, f, g,
 h}, x] && NeQ[e^2 - 4*d*f, 0] && NegQ[-(a*c)]

Rubi steps

\begin {align*} \int \frac {a-c+b x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx &=-\frac {\int \frac {-b^2-(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )-b \sqrt {a^2+b^2-2 a c+c^2} x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx}{2 \sqrt {a^2+b^2-2 a c+c^2}}+\frac {\int \frac {-b^2-(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )+b \sqrt {a^2+b^2-2 a c+c^2} x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx}{2 \sqrt {a^2+b^2-2 a c+c^2}}\\ &=\left (b \left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \operatorname {Subst}\left (\int \frac {1}{-2 b \sqrt {a^2+b^2-2 a c+c^2} \left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )+b x^2} \, dx,x,\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {a+b x+c x^2}}\right )+\left (b \left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \operatorname {Subst}\left (\int \frac {1}{2 b \sqrt {a^2+b^2-2 a c+c^2} \left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )+b x^2} \, dx,x,\frac {-b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {a+b x+c x^2}}\right )\\ &=-\frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \tan ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2}}-\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \tanh ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.08, size = 136, normalized size = 0.28 \[ \frac {1}{2} i \left (\sqrt {a+i b-c} \tanh ^{-1}\left (\frac {2 a+b (x+i)+2 i c x}{2 \sqrt {a+i b-c} \sqrt {a+x (b+c x)}}\right )-\sqrt {a-i b-c} \tanh ^{-1}\left (\frac {2 a+b (x-i)-2 i c x}{2 \sqrt {a-i b-c} \sqrt {a+x (b+c x)}}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(a - c + b*x)/((1 + x^2)*Sqrt[a + b*x + c*x^2]),x]

[Out]

(I/2)*(-(Sqrt[a - I*b - c]*ArcTanh[(2*a - (2*I)*c*x + b*(-I + x))/(2*Sqrt[a - I*b - c]*Sqrt[a + x*(b + c*x)])]
) + Sqrt[a + I*b - c]*ArcTanh[(2*a + (2*I)*c*x + b*(I + x))/(2*Sqrt[a + I*b - c]*Sqrt[a + x*(b + c*x)])])

________________________________________________________________________________________

fricas [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a-c)/(x^2+1)/(c*x^2+b*x+a)^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a-c)/(x^2+1)/(c*x^2+b*x+a)^(1/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Warn
ing, need to choose a branch for the root of a polynomial with parameters. This might be wrong.The choice was
done assuming [a,b,c]=[42,62,91]Warning, choosing root of [1,0,%%%{-2,[2,0,0]%%%}+%%%{4,[1,0,1]%%%}+%%%{4,[1,0
,0]%%%}+%%%{-2,[0,2,0]%%%}+%%%{-2,[0,0,2]%%%}+%%%{-4,[0,0,1]%%%},%%%{-8,[2,0,0]%%%}+%%%{16,[1,0,1]%%%}+%%%{-8,
[0,2,0]%%%}+%%%{-8,[0,0,2]%%%},%%%{1,[4,0,0]%%%}+%%%{-4,[3,0,1]%%%}+%%%{4,[3,0,0]%%%}+%%%{2,[2,2,0]%%%}+%%%{6,
[2,0,2]%%%}+%%%{-12,[2,0,1]%%%}+%%%{-4,[1,2,1]%%%}+%%%{4,[1,2,0]%%%}+%%%{-4,[1,0,3]%%%}+%%%{12,[1,0,2]%%%}+%%%
{1,[0,4,0]%%%}+%%%{2,[0,2,2]%%%}+%%%{-4,[0,2,1]%%%}+%%%{-4,[0,2,0]%%%}+%%%{1,[0,0,4]%%%}+%%%{-4,[0,0,3]%%%}] a
t parameters values [-27,26,-89]Warning, need to choose a branch for the root of a polynomial with parameters.
 This might be wrong.The choice was done assuming [a,b]=[-66,-52]Evaluation time: 7.83Unable to convert to rea
l %%%{1.0,[2]%%%}+%%%{132.0,[1]%%%}+%%%{7060.0,[0]%%%} Error: Bad Argument Value

________________________________________________________________________________________

maple [B]  time = 0.52, size = 6871419, normalized size = 14197.15 \[ \text {output too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a-c)/(x^2+1)/(c*x^2+b*x+a)^(1/2),x)

[Out]

result too large to display

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {b x + a - c}{\sqrt {c x^{2} + b x + a} {\left (x^{2} + 1\right )}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a-c)/(x^2+1)/(c*x^2+b*x+a)^(1/2),x, algorithm="maxima")

[Out]

integrate((b*x + a - c)/(sqrt(c*x^2 + b*x + a)*(x^2 + 1)), x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {a-c+b\,x}{\left (x^2+1\right )\,\sqrt {c\,x^2+b\,x+a}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a - c + b*x)/((x^2 + 1)*(a + b*x + c*x^2)^(1/2)),x)

[Out]

int((a - c + b*x)/((x^2 + 1)*(a + b*x + c*x^2)^(1/2)), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {a + b x - c}{\left (x^{2} + 1\right ) \sqrt {a + b x + c x^{2}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a-c)/(x**2+1)/(c*x**2+b*x+a)**(1/2),x)

[Out]

Integral((a + b*x - c)/((x**2 + 1)*sqrt(a + b*x + c*x**2)), x)

________________________________________________________________________________________